﻿<ResourceDictionary 
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


    <DataTemplate  x:Key="DataTepmBool" DataType="Boolean" >
        <CheckBox IsChecked="{Binding Path=Значение, Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged}"
                                                  Content="{Binding Path=Значение}"
                                                  Padding="7,0" VerticalAlignment="Center" VerticalContentAlignment="Center" />
    </DataTemplate>
    
    
    
    <DataTemplate  x:Key="DataTepmNullableBool">
        <CheckBox IsChecked="{Binding Path=Значение}"
                                                  Content="{Binding Path=Значение, UpdateSourceTrigger=PropertyChanged}"
                                                  IsThreeState="True"
                                                  Padding="7,0" VerticalAlignment="Center" VerticalContentAlignment="Center" />
    </DataTemplate>
    
    <DataTemplate  x:Key="DataTepmChecBoxПросмотр">
        <CheckBox IsChecked="{Binding Path=Значение}"
                                                  Content="{Binding Path=Значение}"
                                                  IsEnabled="False"
                                                  Padding="7,0" VerticalAlignment="Center" VerticalContentAlignment="Center" />
    </DataTemplate>
    
    <DataTemplate x:Key="Перечислитель">
              <ComboBox ItemsSource="{Binding  Path=СписокПеречислителя}" HorizontalAlignment="Left"
                                Text="{Binding   Path= Значение}" 
                          />
      
    </DataTemplate>

    

    <DataTemplate x:Key="Флаг">
        <ContentControl Grid.Column="7" Content="{Binding Path=ВизуализаторЗначения}"/>
            <!--<StackPanel Name="FF"  Orientation="Horizontal" >
                <TextBox Text="{Binding Path=Значение, Mode=TwoWay}" TextWrapping="Wrap" MaxWidth="300"   />
                <ComboBox  ItemsSource="{Binding  Path=СписокПеречислителя, UpdateSourceTrigger=PropertyChanged}" 
                                                  Text="{Binding   Path= Значение, Mode=TwoWay}"  />
            </StackPanel>-->
    </DataTemplate>
    
    

    <DataTemplate x:Key="Примитив">
        <TextBox Text="{Binding Path=Значение}" Padding="0" BorderThickness="0" MinWidth="20" >
            <TextBox.Style>
                <Style >
                    <Style.Triggers>
                        <DataTrigger  Binding="{Binding Path=Значение}" Value="{x:Null}">
                            <Setter Property="TextBox.Background" Value="Black" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBox.Style>
        </TextBox>
    </DataTemplate>

    <DataTemplate x:Key="ЛюбойОбъект">
        <Border BorderThickness="1"  BorderBrush="OliveDrab"  >
            <TextBlock Text="{Binding Path=Тип.Имя}" 
                      ToolTip="{Binding Path=Тип.Описание}" >
               <TextBlock.Style>
                <Style >
                    <Style.Triggers>
                        <Trigger Property="TextBlock.IsMouseOver" Value="True">
                        <Setter Property="TextBlock.Foreground" Value="Blue" />
                    </Trigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
            </TextBlock>
        </Border>
           
    </DataTemplate> 


    <DataTemplate x:Key="TextBoxDefR">
        <TextBlock Text="{Binding Path=Значение}"  />
    </DataTemplate>
    
</ResourceDictionary>
